/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Traffic;

import java.awt.Color;
import java.awt.Graphics;
import java.util.ArrayList;
import javax.swing.JPanel;

/**
 *
 * @author Matthew
 */
public class VehicleTesterView extends JPanel{

    ArrayList<Vehicle> vehicles;

    VehicleTesterView()
    {

    }



    public void setVehicleArray(ArrayList<Vehicle> v)
    {
        vehicles = v;
    }

    @Override
    public void paintComponent(Graphics g)
    {
        g.setColor(Color.gray);
        g.fillRect(0, 0, 500, 120);


        for (Vehicle v:vehicles)
        {
            if (v.turning == VehicleTurn.NO)
                g.setColor(Color.BLACK);
            else
                g.setColor(Color.RED);
            
            g.fillRect(v.position.x * 10 , v.position.y * 10, v.position.xLength * 10, v.position.yLength * 10);
        }
    }

}
